<template>
  <div class="category list-page">
    <div class="function-area">
      <el-button @click="toShowDev">添加分类</el-button>
    </div>
    <div class="list-area">
      <el-table :data="categoryTree" row-key="code">
        <el-table-column label="分类名" prop="name"> </el-table-column>
        <el-table-column label="分类唯一标识符" prop="code"> </el-table-column>
        <el-table-column label="操作">
          <template #default="{ row, $index }">
            <el-button type="text" @click="toShowDev(row, $index)">编辑</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ElNotification } from 'element-plus'
import { categoryTree } from '@/indexDB/initCategory'

const toShowDev = (info: any, index: number) => {
  ElNotification({
    message: '开发中，敬请期待',
    appendTo: document.body
  })
}
</script>

<style lang="scss" scoped>
@import '@/assets/list.scss';
</style>
